#pragma once
#include "IBase.h"
#include "../SGD Wrappers/SGD_Declarations.h"	
#include "AnimTimeStamp.h"

class BaseObject : public IBase
{
protected:

	SGD::Point m_ptPosition = { 0, 0 };
	SGD::Size m_szSize = { 0, 0 };
	float m_fRotation = 0.0f;
	AnimTimeStamp animation;
	unsigned char alpha = (char)255;


private:

	unsigned int m_unRefCount = 1;

public:
	enum ObjectType{
		OBJ_PLAYER, OBJ_GUARD, OBJ_DOG, OBJ_WORKER, OBJ_OFFICER, OBJ_CAMERA, OBJ_TURRET, OBJ_THERMAL_CAM, OBJ_TRIP_LASER, OBJ_GUARD_SPAWNER, OBJ_DOG_SPAWNER,
		OBJ_KEYCARD, OBJ_INTEL, OBJ_POWERCORE, OBJ_STIMPACK, OBJ_KEYPAD, OBJ_DOOR, OBJ_COMPUTER, OBJ_ALARM_BUTTON,
		 OBJ_BASE, OBJ_VDESK, OBJ_HDESK, OBJ_FILECAB, OBJ_WALL, OBJ_CHAIR, OBJ_TABLE,
		 OBJ_ELITE_GUARD, OBJ_ULCSHADOW, OBJ_BLCSHADOW, OBJ_URCSHADOW, OBJ_BRCSHADOW, OBJ_FILLSHADOW, OBJ_MOVING, OBJ_ENEMY_UNIT, OBJ_BULLET, OBJ_IGNORE, OBJ_TRIGGER, OBJ_PLAYERCOLLISION
	};


	BaseObject() = default;
	~BaseObject();

	virtual void			Update(float elapsedTime)	 override;
	virtual void			Render(void)				 override;

	virtual int				GetType(void)	const { return OBJ_BASE; }
	virtual SGD::Rectangle	GetRect(void)	const;
	virtual void			HandleCollision(const IBase* pOther) override;


	virtual void	AddRef(void) final; 
	virtual void	Release(void) final;

	//Accessors
	SGD::Point	GetPosition(void) const			{ return m_ptPosition; }
	SGD::Size	GetSize(void) const				{ return m_szSize; }
	float		GetRotation(void) const			{ return m_fRotation; }
	std::string	GetAnimation(void) const		{ return animation.m_strCurrAnimation; }
	AnimTimeStamp GetAnimationStamp(void) const		{ return animation; }


	//Mutators
	void		SetPosition(SGD::Point	pos) 	{ m_ptPosition = pos; }
	void		SetSize(SGD::Size size) 		{ m_szSize = size; }
	void		SetRotation(float rad)			{ m_fRotation = rad; }
	void		SetAnimation(std::string animName);



};

